package com.tangula.web.kashine.business;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.tangula.web.kashine.entity.SendMoneyScheduleEntity;
import com.tangula.web.kashine.repository.SendMoneyScheduleEntityRepository;

@Service
public class ScheduleBusinessImpl implements ScheduleBusiness{

	@Autowired
	SendMoneyScheduleEntityRepository repo;
	
	@Override
	public List<SendMoneyScheduleEntity> allTeacherNotFinishTask(){
		return repo.findByTypeAndExecResult(SendMoneyScheduleEntity.TYPE_TEACHRE_2_STUDENT, SendMoneyScheduleEntity.TYPE_EXEC_RESULT_NOT_EXEC);
	}

	@Override
	public boolean createOrSave(SendMoneyScheduleEntity entity) {
		if(entity!=null) {
			repo.saveAndFlush(entity);
		}
		return true;
	}
	
}
